<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags"%>
<%@ taglib prefix="bigk" uri="/bigk-tags"%>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display" %>

<s:if test="pId == null">
    <s:set var="actionName">save</s:set>
    <s:set var="titleKey">invoicespositionsaction.title.create</s:set>
</s:if>
<s:else>
    <s:set var="actionName">update</s:set>
    <s:set var="titleKey">invoicespositionsaction.title.update</s:set>
</s:else>

<html>

  <head>
    <title><s:text name="invoicespositionsaction.title"/></title>
  </head>

  <body>

    <p class="wwPageTitle">
      <img src="<s:url value='/images/invoice.gif'/>"/>
      <s:text name="%{#titleKey}">
        <s:param value="invoice.year"/>
        <s:param value="invoice.number"/>
      </s:text>
    </p>

    <s:actionerror />
    <s:actionmessage/>
    <s:fielderror />

    <s:form namespace="/invoicesPositions"
            action="%{#actionName}"
            method="POST"
            cssClass="wwFilterTable">

      <s:hidden name="pId" />

      <tr>
        <th colspan="2">
          <s:text name="%{#titleKey}">
            <s:param value="invoice.year"/>
            <s:param value="invoice.number"/>
          </s:text>
\
        </th>
      </tr>

      <s:textfield key="invoicePosition.quantity"
                   name="model.quantity"
                   required="true"
                   size="10"/>
                   
      <s:textarea key="invoicePosition.serviceName"
                  name="model.serviceName"
                  required="true"
                  cols="75"
                  rows="4"/>

      <s:textfield key="invoicePosition.symbol"
                   name="model.symbol"
                   required="true"
                   size="20"/>

      <s:textfield key="invoicePosition.measure"
                   name="model.measure"
                   required="true"
                   size="10"/>

      <s:textfield key="invoicePosition.priceNetto"
                   name="model.priceNetto"
                   required="true"
                   size="10"/>

      <s:select key="invoicePosition.percentTax"
                name="model.taxId"
                required="true"
                list="taxesList"
                listKey="id"
                listValue="description" />

      <tr>
        <td colspan="2" class="wwFilterTableButtonBar">
          <s:submit key="button.submit" cssClass="inputButton" theme="simple"/>
          <s:submit key="button.cancel" cssClass="inputButton" theme="simple" action="backToInvoice" />
        </td>
      </tr>
      
    </s:form>

  </body>

</html>
